import random
d = random . randint(0,9)
s=365
for i in range(s+1):
    i+=1
    try:
        n = int(input("请输入一个0——9之间的整数:"))
        i = 1
        p = 1
        s = 365
        for i in range(s + 1):
            if n == d:
                print("预测{:.0f}次，你猜中了".format(p))
                break
            elif n < d:
                p += 1
                print("遗憾，太小了")
                n = int(input("请输入一个0——9之间的整数:"))
            else:
                p += 1
                print("遗憾，太大了")
                n = int(input("请输入一个0——9之间的整数:"))
    except ValueError:
        print("输入内容必须为整数！")